//
//  DDddd.swift
//  DingDongZP
//
//  Created by 三秒文化 on 2016/10/19.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

import UIKit

class DDOpenInvoiceHistoryListCell: LDBaseCells {
    
    
    private var codeLab:UILabel?
    private var amountLab:UILabel?
    private var divideLine:UIView?
    
    var model:DDInvoiceHistoryListModel? {
        
        didSet{
            
            let codeStr = model?.no ?? ""
            let monStr = model?.money ?? ""
            
            codeLab?.text = "开票信息编号 " + codeStr
            amountLab?.text = "开票金额: " + monStr
        }
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        initUI()
    }

    
    func initUI() {
        
        codeLab = UILabel.setBaseLab("daf", fontSize: 13, titleColor: LDFontColor.Black, Alignment: .Left)
        amountLab = UILabel.setBaseLab("dadf", fontSize: 13, titleColor: LDFontColor.Black, Alignment: .Right)
        divideLine = UIView()
        divideLine?.backgroundColor = LDLineColorLightGray
        
        
        
        addSubview(codeLab!)
        addSubview(amountLab!)
        addSubview(divideLine!)
        
        codeLab?.snp_makeConstraints(closure: { (make) in
            
            make.centerY.equalTo(self)
            make.left.equalTo(LDMargin_V*4)
            make.height.equalTo(25)
        })
        
        amountLab?.snp_makeConstraints(closure: { (make) in
            
            make.centerY.equalTo(self)
            make.right.equalTo(-LDMargin_V*4)
            make.height.equalTo(25)
        })
        
        divideLine?.snp_makeConstraints(closure: { (make) in
            
            make.left.right.bottom.equalTo(0)
            make.height.equalTo(0.5)
        })
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
